import 'package:json_annotation/json_annotation.dart';
part 'dapp_hot_model.g.dart';

@JsonSerializable()
class DAppWalletHotModel {
  int total;
  @JsonKey(name: "bookmarkList")
  List<BookMarkListModel>? bookmarkList;

  DAppWalletHotModel({required this.total, required this.bookmarkList});

  factory DAppWalletHotModel.fromJson(Map<String, dynamic> json) =>
      _$DAppWalletHotModelFromJson(json);

  Map<String, dynamic> toJson() => _$DAppWalletHotModelToJson(this);
}

@JsonSerializable()
class BookMarkListModel {
  BookMarkListItemModel bookmark;
  @JsonKey(name: "children")
  List<BookMarkListModel>? children;

  BookMarkListModel({
    required this.bookmark,
    this.children,
  });

  factory BookMarkListModel.fromJson(Map<String, dynamic> json) =>
      _$BookMarkListModelFromJson(json);

  Map<String, dynamic> toJson() => _$BookMarkListModelToJson(this);
}

@JsonSerializable()
class BookMarkListItemModel {
  int id;
  int parentId;
  int type;
  String statement;
  String name;
  String logo;
  String url;
  String? introduce;

  BookMarkListItemModel({
    required this.id,
    required this.parentId,
    required this.type,
    required this.statement,
    required this.name,
    required this.logo,
    required this.url,
    this.introduce,
  });

  factory BookMarkListItemModel.fromJson(Map<String, dynamic> json) =>
      _$BookMarkListItemModelFromJson(json);

  Map<String, dynamic> toJson() => _$BookMarkListItemModelToJson(this);
}
